import requests
# 添加部门
resp = requests.post(url="http://ihrm-test.itheima.net/api/company/department",
                     headers={"Authorization": "31e0ac99-7b47-4e51-99d1-cc70e45b822a"},
                     json={"name": "排雷部", "code": "007"})
print("添加部门：", resp.json())

# 查询部门
resp = requests.get(url="http://ihrm-test.itheima.net/api/company/department/1516422979582525440",
                    headers={"Authorization": "31e0ac99-7b47-4e51-99d1-cc70e45b822a"})
print("查询部门：", resp.json())

# 修改部门
resp = requests.put(url="http://ihrm-test.itheima.net/api/company/department/1516422979582525440",
                    headers={"Authorization": "31e0ac99-7b47-4e51-99d1-cc70e45b822a"},
                    json={"name": "造雷部", "code": "008"})
print("修改部门：", resp.json())

# 删除部门
resp = requests.delete(url="http://ihrm-test.itheima.net/api/company/department/1516422979582525440",
                       headers={"Authorization": "31e0ac99-7b47-4e51-99d1-cc70e45b822a"})
print("删除部门：", resp.json())